home *** CD-ROM | disk | FTP | other *** search
/ NOVA - For the NeXT Workstation / NOVA - For the NeXT Workstation.iso / Documents / NeXTAnswers / appkit.805 < prev    next >
Text File  |  1992-02-06  |  2KB  |  65 lines

  1. {\rtf0\ansi{\fonttbl\f0\fnil Times-Roman;\f1\fmodern Courier;\f2\fswiss Helvetica;}
  2. \paperw12940
  3. \paperh9000
  4. \margl120
  5. \margr1000
  6. {\colortbl\red0\green0\blue0;}
  7. \pard\tx1140\tx2300\tx3440\tx4600\tx5760\tx6900\tx8060\tx9200\tx10360\tx11520\f0\b0\i0\ul0\fs28\fc0 cc1 fatal signal 10 compiler crash bug workaround
  8. \pard\tx960\tx1920\tx2880\tx3840\tx4800\tx5760\tx6720\tx7680\tx8640\tx9600 \
  9. \
  10. Q:  I am using the struct 
  11. \b NXDefaultsVector
  12. \b0  as an argument in my method as follows:\
  13. \
  14.  
  15. \f1\fs24     
  16. \fc0 -initForOwner:(const char *)owner withVector:(NXDefaultsVector *)vector;\
  17.  
  18. \f0\b\fs28     
  19. \b0 \
  20. When compiling this code, I consistently get the error message: \
  21. \
  22.         
  23. \f1\fs24 Program cc1 got fatal signal 10\
  24.         
  25. \f0\fs28 \
  26. What can I do?\
  27. \
  28. A:  The problem is caused by the type of the second argument of the method:\
  29. \
  30.  
  31. \f1\fs24     -initForOwner:(const char *)owner withVector:(NXDefaultsVector *)vector;\
  32.  
  33. \f0\b\fs28     \
  34.  
  35. \b0 Since 
  36. \b NXDefaultsVector
  37. \b0  is defined to be:\
  38. \
  39.     
  40. \f1\fs24 typedef struct  _NXDefault NXDefaultsVector[];\
  41.     
  42. \f0\fs28 \
  43. the compiler crashes because it tries to encode a pointer to an array of unknown size. The compiler  also generates this fatal error if you use the Objective-C 
  44. \b @encode
  45. \b0  directive for arrays of unknown size such as in 
  46. \f1\fs24 @encode(char[])
  47. \f0\fs28 .\
  48. \
  49. The easiest workaround is to avoid using them.  The above method can be rewritten as:\
  50. \
  51.  
  52. \f1\fs24     -initForOwner:(const char *)owner withVector:(NXDefaultsVector)vector;\
  53.  
  54. \f0\b\fs28     
  55. \b0 \
  56. This bug has been reported and will be fixed in the next major software release.\
  57. \
  58. \
  59. QA805\
  60. \
  61. Not tested  for 1.0\
  62. Valid for 2.0\
  63. \
  64.  
  65.